<?php
/**
 * CEOfox
 *
 * @copyright  Copyright 2011-2012 CEOfox, Inc.
 * @license    http://ceofox.com/pages/license
 * @version    $Id: profile.component_block_header_clean.php 47086 2013-05-24 09:40:17 $
 * @author     CEOfox, Inc.
 */
?>
<?php
    if(Phpfox::isModule('follow'))
    {
        $oFollow = Phpfox::getService('follow');
        if($aUser = $this->getParam('aUser'))
        {
            $bCanFollow = $oFollow->canFollow($aUser['user_id']);
            if($bCanFollow)
            {
                $bIsFollow = $oFollow->isFollow(Phpfox::getUserId(),$aUser['user_id'], 'user');
                $bIsCurrentUser = ($aUser['user_id'] == phpfox::getUserId()) ? true: false;
                echo '<script type="text/javascript">$Core.follow.url(\'' . Phpfox::getLib('url')->makeUrl('follow') . '\');</script>';
                echo '<script type="text/javascript">$Core.follow.setPhrases(\''. phpfox::getPhrase('follow.follow').'\', \''. phpfox::getPhrase('follow.unfollow').'\', \''. phpfox::getPhrase('follow.following').'\');</script>';
                echo '<script type="text/javascript">$Core.follow.getInfoFollow(
                    \''.Phpfox::getUserId().'\',
                    \''.(($bIsFollow == false)? 0: 1).'\',
                    \''.(($bIsCurrentUser == false)? 0: 1).'\',
                    \'user\',
                    \''.$aUser['user_id'].'\'
                    );</script>';
                unset($bIsCurrentUser);
                unset($bIsFollow);
        }
        unset($aFollow);
        unset($bCanFollow);
        unset($aUser);
        }
        
    }
?>
